const mysql = require('mysql')

const con = mysql.createPool({
  host: "localhost",
  user: "root",
  password: "3051532wyp.",
  database: "s_1711A_demo"
})

const exec = (sql) => {
  return new Promise((resolve, reject) => {
    con.query(sql, (err, data) => {
      if (err) reject(err);
      resolve(data)
    })
  })
}

module.exports = {
  exec
}